﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WooCoo.Data;
using WooCoo.ObjectModel;
using WooCoo.ObjectModel.ManagedProperty;

namespace WooCooTest.Serialization
{
    public interface IFoo
    {
        string Name { get; set; }
    }

    public class Foo : IFoo
    {
        public string Name { get; set; }
    }

    public class Bar
    {
        public bool IsFoo;

        public int Id { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string GetName()
        {
            return string.Format("{0} {1}", this.FirstName, this.LastName);
        }
    }

    public class Fish
    {
        public int? Count { get; set; }
    }

    public struct EmptyStruct { }

    public struct Struct
    {
        public string Name { get; set; }
    }

    public class UserInfo : WooCoo.ObjectModel.Entity
    {
        public UserInfo()
        {
        }
        public override object GetIdValue()
        {
            return this.KeyID.ToString();
        }

        public static readonly PropertyInfo<string> KeyIDProperty = P<UserInfo>.RegisterProperty<string>(c => c.KeyID);
        [Required()]
        //[Column(Name = "KeyID", IsIdentity = true)]
        public string KeyID
        {
            get { return this.GetProperty<string>(KeyIDProperty); }
            set { this.SetProperty<string>(KeyIDProperty, value); }
        }
    }
}
